package Arrays;

/**
 * 作者:hfj
 * 功能:326.3的幂
 * 日期: 2025/11/12 11:16
 */
public class IsPowerOfThree {

    public static void main(String[] args) {
        System.out.println(isPowerOfThree(89));
    }

    public static boolean isPowerOfThree(int n) {
        long i = 1;
        while(i <= n){
            if(i == n){
                return true;
            }
            i *= 3;
        }
        return false;
    }
}
